﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DomMgmtSystem.View
{
    public partial class ChangePwd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (txtOldPwd.Text.Trim() != CommonCode.CurUser.CPASSWORD)
            {
                this.Alert("原密码输入错误");
                return;
            }
            Model.TB_USER model = CommonCode.CurUser;
            model.CPASSWORD = txtNewPwd.Text.Trim();
            if (DataAccess.TB_USER.Update(model))
                this.Alert("修改成功！");
            else
                this.Alert("修改失败！");
        }
    }
}